package com.lzx.spring3;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import com.lzx.spring3.meta.User;

public class Spring3Main {

	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
				"beans.xml");

	
		
		JdbcTemplate jdbcTemplate = applicationContext.getBean("jdbcTemplate", JdbcTemplate.class);
		System.out.println(jdbcTemplate);
		
//		AppConfig appConfig = applicationContext.getBean(AppConfig.class);
		System.out.println(AppConfig.userName);
		
//		System.out.println(AppConfig.userName);
		
		String sql = "select * from user";
		List list = jdbcTemplate.queryForList(sql);
		System.out.println(list.size());
	}

}
